package com.jy.admin.db.dao.impl;
import com.fqgj.common.base.AbstractBaseMapper;
import com.jy.admin.db.dao.CeOrdersDetailDao;
import com.jy.admin.db.entity.CeOrdersDetailEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.Map;

/**
* User: anonymous
* Date: 2022-01-03
* Time: 18:14:20.177
*/

@Repository
public class CeOrdersDetailDaoImpl extends AbstractBaseMapper<CeOrdersDetailEntity> implements CeOrdersDetailDao {


    @Override
    public CeOrdersDetailEntity getByKeyAndMerchantAndOrderNo(String merchantCode, String key, String orderNo) {
        Map<String, Object> params = new HashMap<>();
        params.put("merchantCode", merchantCode);
        params.put("dataKey", key);
        params.put("orderNo", orderNo);
        return getSqlSession().selectOne(this.getStatement("getByKeyAndMerchantAndOrderNo"), params);
    }

    @Override
    public CeOrdersDetailEntity getByKeyAndMerchantAndOrderNoToday(String merchantCode, String key, String orderNo) {
        Map<String, Object> params = new HashMap<>();
        params.put("merchantCode", merchantCode);
        params.put("dataKey", key);
        params.put("orderNo", orderNo);
        return getSqlSession().selectOne(this.getStatement("getByKeyAndMerchantAndOrderNoToday"), params);
    }
}